/**
 * Copyright (c) <2010>, <SUNNY GUPTA>
 * All rights reserved.

 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *   * Neither the name of the <ORGANIZATION> nor the
 *     names of its contributors may be used to endorse or promote products
 *     derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL <SUNNY GUPTA> BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package com.gwtp.investmentadvisor.shared.entities;

import java.io.Serializable;


/**
 * <p>A 'lightweight' view-only version of {@link FinancialSecurity}.</p>
 * <p>Needs to implement {@link Serializable} for RPC</p>
 * @author Sunny Gupta
 *
 */
public class FinancialSecurityView implements Serializable {
  /**
   * 
   */
  private static final long serialVersionUID = 5875032804459627004L;
  
  /**
   * Need to initialise with the UID.
   * @param uniqueIdentifier
   */
  public FinancialSecurityView(String uniqueIdentifier) {
    this.uniqueIdentifier = uniqueIdentifier;
    this.isUniqueIdentifierValid = true;
  }
  
  /**
   * Can be used to initialise when UID is invalid.
   * Required for serialization
   */
  public FinancialSecurityView() {
    this.isUniqueIdentifierValid = false;
  }
  
  /**
   * @param name the name to set
   */
  public void setName(String name) {
    this.name = name;
  }
  /**
   * @return the name
   */
  public String getName() {
    return name;
  }

  /**
   * @param tickerSymbol the tickerSymbol to set
   */
  public void setTickerSymbol(String tickerSymbol) {
    this.tickerSymbol = tickerSymbol;
  }

  /**
   * @return the tickerSymbol
   */
  public String getTickerSymbol() {
    return tickerSymbol;
  }

  /**
   * @param currentMarketPrice the currentMarketPrice to set
   */
  public void setCurrentMarketPrice(String currentMarketPrice) {
    this.currentMarketPrice = currentMarketPrice;
  }

  /**
   * @return the currentMarketPrice
   */
  public String getCurrentMarketPrice() {
    return currentMarketPrice;
  }

  /**
   * @return the uniqueIdentifier
   */
  public String getUniqueIdentifier() {
    return uniqueIdentifier;
  }

  /**
   * @param currencySymbol the currencySymbol to set
   */
  public void setCurrencyCode(String currencySymbol) {
    this.currencyCode = currencySymbol;
  }

  /**
   * @return the currencySymbol
   */
  public String getCurrencyCode() {
    return currencyCode;
  }

  /**
   * @return the isUniqueIdentifierValid
   */
  public boolean isUniqueIdentifierValid() {
    return isUniqueIdentifierValid;
  }

  /**
   * @param exchangeName the exchangeName to set
   */
  public void setExchangeName(String exchangeName) {
    this.exchangeName = exchangeName;
  }

  /**
   * @return the exchangeName
   */
  public String getExchangeName() {
    return exchangeName;
  }

  private String name;
  private String tickerSymbol;
  private String currentMarketPrice;
  private String uniqueIdentifier;
  private String currencyCode;
  private boolean isUniqueIdentifierValid;
  private String exchangeName;
  private String financialSecurityType;
  
  /**
   * Shallow Copy since all members are primitive types.
   */
  public FinancialSecurityView clone() {
       FinancialSecurityView newView = new FinancialSecurityView();
       newView.setCurrencyCode(this.currencyCode);
       newView.setCurrentMarketPrice(this.currentMarketPrice);
       newView.setExchangeName(this.exchangeName);
       newView.setName(this.name);
       newView.setTickerSymbol(this.tickerSymbol);
       newView.setFinancialSecurityType(this.financialSecurityType);
       
       return newView;
    }

  /**
   * @param financialSecurityType the financialSecurityType to set
   */
  public void setFinancialSecurityType(String financialSecurityType) {
    this.financialSecurityType = financialSecurityType;
  }

  /**
   * @return the financialSecurityType
   */
  public String getFinancialSecurityType() {
    return financialSecurityType;
  }
}
